#include <stm8s_tim2.h>

void TIM2_OC2PolarityConfig(TIM2_OCPolarity_TypeDef TIM2_OCPolarity)
{
  /* Check the parameters */
  assert_param(IS_TIM2_OC_POLARITY_OK(TIM2_OCPolarity));
  
  /* Set or Reset the CC2P Bit */
  if (TIM2_OCPolarity != TIM2_OCPOLARITY_HIGH)
  {
    TIM2->CCER1 |= TIM2_CCER1_CC2P;
  }
  else
  {
    TIM2->CCER1 &= (uint8_t)(~TIM2_CCER1_CC2P);
  }
}

/**
  * @brief  Configures the TIM2 Channel 3 polarity.
  * @param   TIM2_OCPolarity specifies the OC3 Polarity.
  * This parameter can be one of the following values:
  *                       - TIM2_OCPOLARITY_LOW: Output Compare active low
  *                       - TIM2_OCPOLARITY_HIGH: Output Compare active high
  * @retval None
  */
